<%-- 
    Document   : Respaldo
    Created on : 20/01/2012, 03:24:56 AM
    Author     : Moraima Joves
--%>

<%@page import="Logica.Respaldo"%>
<%@page import="java.util.*" session="true"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<% 
String actionMethod=request.getMethod();
String url=request.getRequestURI().toString();
if(actionMethod.equalsIgnoreCase("get") && 
        (request.getParameter("accion") != null)){
    if(request.getParameter("accion").equals("respaldar")){        
        Respaldo respaldo = new Respaldo();
        respaldo.Respaldar();
         %>
        <script>alert('Se Ha Respaldado Satisfactoriamente');</script>
       <%
    }
    if(request.getParameter("accion").equals("aplicar")){        
        Respaldo respaldo = new Respaldo();
        respaldo.AplicarRespaldo(request.getParameter("nombre"));
        %>
        <script>alert('Se ha aplicado el respaldo Satisfactoriamente');</script>
       <%
       
        response.sendRedirect("index.jsp");
    }
    
}
       
    Respaldo respal = new Respaldo();
    List<String> lista = respal.ObtenerListaRespaldo();
%>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>Proyecto Distribuido</title>
	<link href="css/style.css" rel="stylesheet" type="text/css"> 
	</head>
	
	<body>
	<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
	<tbody><tr>
	<td>
	<table width="1000" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr>
	<td background="images/top-bg.jpg"><div width="337" height="107"> <h1 style="font-size:40px"> Sistemas Distribuidos</h1> </div>
	  <table width="284" border="0" align="right" cellpadding="0" cellspacing="0">
	    <tbody>
	      
	      
	      </tbody></table>	  </td>
	</tr>
	</tbody></table>
	</td>
	</tr>
	
	<tr>
	<td id="button-bg">
	<ul>
	<li><a href="index.jsp">Inicio</a></li>
	<li><a href="RespaldoPerdida.jsp"  class="highlight-button" >Respaldo</a></li>
	</ul>
	</td>
	</tr>
	<tr>
	<td bgcolor="#ddeefe">
	<table width="1000" border="0" cellspacing="0" cellpadding="0">
	<tbody><tr>
	<td width="15" height="15"></td>
	<td></td>
	<td width="15" height="15"></td>
	<td></td>
	<td width="15" height="15"></td>
	</tr>
	<tr>
            <td colspan="5" valign="top" align ="center">
	<h1><img src="images/arrow.jpg" alt="" width="14" height="10" hspace="4" vspace="2"> Respaldo </h1>
        <a href="Respaldo.jsp?accion=respaldar"> </a>
        <table width="275" border="1">
          <tr>
            <td width="113">Fecha Respaldo</td>
            <td width="48">&nbsp;</td>
            </tr>
          <% for (String nombre : lista) {%> 
          <tr>
            <td><%=nombre%></td>
            <td><a href="RespaldoPerdida.jsp?accion=aplicar&nombre=<%=nombre%>">Aplicar</a></td>
            </tr>
           <% } %>
        </table>
	 <br>
	
	
	</td>
	</tr>
	</tbody></table>
	</td></tr>
	<tr>
	<td height="15" bgcolor="#DDEEFE"></td>
	</tr>
	<tr>
	<td class="footer-text"><a href="index.html">Home</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">About Us</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Order</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Affiliates</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Newsletter</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="#">Contact Us</a><br>
	<span class="footer-text1">Copyright Â© 2009 domainforsale.com. All Rights Reserved</span></td>
	</tr>
	</tbody></table>
	
	
	
</body></html>
